
	mui.init();
	var userinfo = app.getState();
	var uid = userinfo.user_id;
	var qrcode = new QRCode('qr', {
		text: 'cash@' + uid,
		width: 200,
		height: 200,
		colorDark: '#000000',
		colorLight: '#ffffff',
		correctLevel: QRCode.CorrectLevel.H
	});
	
    mui.plusReady(function() {
    	document.getElementById('uid').innerHTML=uid;
    	
    	//点击保存二维码
    	document.getElementById('save_qrcode').addEventListener('tap', function() {
			var path=document.querySelector('#qr img').src;
			//转成jpg格式存到本地
	        app.baseImgFile('sk_qrcode_'+uid,path,100,function(i){ 
	            //alert(JSON.stringify(i)); 
	            console.log(JSON.stringify(i));
	        }); 
    
            var new_path="_doc/" +'sk_qrcode_'+uid + ".jpg";  
			plus.gallery.save(new_path, function() {
				mui.toast('保存图片成功！');
			}, function() {
				mui.toast('保存失败,请重试');
			});
		}, false);
		
		
		document.getElementById('rollin_record').addEventListener('tap', function() {
			//打开转入记录页
			mui.openWindow({
			    id:'roll_in_record.html',
			    url:'roll_in_record.html',
			    show: {
					autoShow:false
				},
				 waiting:{
			       autoShow:true,//自动显示等待框，默认为true
			       title:'正在加载...'//等待对话框上显示的提示内容
			   }
			});
		}) 		
		
    })